<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.css">
    <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/product.css">
    <title>letao-PC</title>
</head>

<body class="pl-180 ts-padding">
    <!-- 左侧 -->
    <div class="lt-aside bg-color">
        <h4>黑马商城</h4>
        <div class="info">
            <img src="./images/default.png" alt="">
            <p>超级管理员</p>
        </div>
        <!-- 分类管理 -->
        <ul class="aside-nav">
            <li><a href="./user.html"><i class="glyphicon glyphicon-user"></i>用户管理</a></li>
            <li>
                <a href="javascript:void(0);" class="nav-m"><i class="glyphicon glyphicon-th-list"></i>分类管理</a>
                <ul class="my-hide nav-second">
                    <li><a href="first.html">一级分类</a></li>
                    <li><a href="second.html">二级分类</a></li>
                </ul>
            </li>
            <li><a href="product.html"><i class="glyphicon glyphicon-tags"></i>商品管理</a></li>
        </ul>
    </div>
    <!-- 主体 -->
    <div class="lt-main">
        <div class="lt-top pl-180 ts-padding">
            <a href="#" class="pull-left top-toggle"><i class="glyphicon glyphicon-align-justify"></i></a>
            <a href="#" class="pull-right" data-toggle="modal" data-target=".modal-only"><i
                    class="glyphicon glyphicon-log-out"></i></a>
        </div>
        <div class="lt-content">
            <!-- 路径导航 -->
            <ol class="breadcrumb">
                <li><a href="./index.html">管理系统</a></li>
                <li class="active">商品管理</li>
            </ol>
            <div class="product-content">
                <!-- 添加商品 按钮 -->
                <button class="btn btn-default btn-lg btn-add" data-toggle="modal"
                    data-target=".product-modal">添加商品</button>
                <!-- table -->
                <table class="table table-bordered table-hover text-center">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>商品名称</th>
                            <th>商品描述</th>
                            <th>商品库存</th>
                            <th>商品尺寸</th>
                            <th>商品状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>1</td>
                            <td>nike</td>
                            <td>nike</td>
                            <td>200</td>
                            <td>34-49</td>
                            <td>已上架</td>
                            <td>
                                <button class="btn btn-danger">下架</button>
                            </td>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>nike</td>
                            <td>nike</td>
                            <td>200</td>
                            <td>34-49</td>
                            <td>已上架</td>
                            <td>
                                <button class="btn btn-danger">下架</button>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <!-- 分页 -->
                <div class="pull-right">
                    <ul id="paginator"></ul>
                </div>
            </div>
        </div>
        <!-- 模态框 -->
        <div class="modal fade modal-only" tabindex="-1" role="dialog">
            <div class="modal-dialog modal-sm" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">温馨提示</h4>
                    </div>
                    <div class="modal-body">
                        <p>您确定要退出后台管理系统吗？</p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary log-out">确定</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
        <!-- 模态框2 -->
        <div class="modal fade product-modal" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">添加商品</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal form-product" id="form3">
                            <div class="form-group">
                                <!-- 下拉菜单 -->
                                <div style="padding-left: 15px;" class="dropdown">
                                    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
                                        data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                        <span class="cate-two">请选择二级分类</span>
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                        <li><a href="#">Action</a></li>
                                    </ul>
                                    <!-- 隐藏域 -->
                                    <input type="hidden" name="brandId" id="brandId">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-12">
                                    <input type="text" class="form-control" name="proName" id="proName"
                                        placeholder="请输入商品名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-12">
                                    <textarea class="form-control" name="proDesc" id="proDesc"
                                        placeholder="请输入商品描述"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-12">
                                    <input type="text" class="form-control" name="num" id="num" placeholder="请输入商品库存">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-12">
                                    <input type="text" class="form-control" name="size" id="size" placeholder="请输入商品尺码">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-12">
                                    <input type="text" class="form-control" name="oldPrice" id="oldPrice"
                                        placeholder="请输入商品原价">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-12">
                                    <input type="text" class="form-control" name="price" id="price"
                                        placeholder="请输入商品现价">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-4">
                                    <label for="file" class="btn btn-default">上传图片</label>
                                    <!-- name指定图片上传时的name属性 -->
                                    <!-- data-url指定图片上传时的接口地址 -->
                                    <!-- multiple指定多文件上传 -->
                                    <input type="file" multiple name="pic1" id="file" data-url="/product/addProductPic"
                                        class="hide">
                                    <!--隐藏域  -->
                                    <input type="hidden" name="picArr" id="picArr">
                                    <div style="width:500px" class="hidden-img"></div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary" form="form3">添加</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </div>

    <!-- 模板引擎1 -->
    <script type="text/html" id="tmp">
        {{ each rows v i }}
        <tr>
            <td>{{i + 1 + size*(page - 1)}}</td>
            <td>{{ v.proName }}</td>
            <td>{{ v.proDesc }}</td>
            <td>{{ v.num }}</td>
            <td>{{ v.size}}</td>
            <td>{{ v.status == 1?'已上架':'下架'}}</td>
            <td data-id={{ v.id }}>
                {{ if v.status == 1 }}
                <button class="btn btn-danger">下架</button>
                {{ else }}
                <button class="btn btn-success">上架</button>
                {{ /if }}
            </td>
        </tr>
        {{ /each }}
    </script>
    <!-- 模板引擎2 -->
    <script type="text/html" id="tmp-two">
        {{ each rows v i }}
        <li><a class="brandi" href="#" data-id={{ v.id }}>{{ v.brandName }}</a></li>
        {{ /each }}
    </script>
    <script src="./lib/jquery/jquery.js"></script>
    <script src="./lib/bootstrap/js/bootstrap.js"></script>
    <script src="./lib/bootstrap-validator/js/bootstrapValidator.js"></script>
    <script src="./lib/bootstrap-paginator/bootstrap-paginator.js"></script>
    <script src="./lib/artTemplate/template-web.js"></script>
    <script src="./lib/nprogress/nprogress.js"></script>
    <script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="./lib/jquery-fileupload/jquery.iframe-transport.js"></script>
    <script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
    <script src="./js/common.js"></script>
    <script src="./js/product.js"></script>
</body>

</html>